using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CheckPoint : MonoBehaviour
{
    private Animator anim;
    public string checkPointId;
    public bool actived;
    private void Start()
    {
        anim = GetComponent<Animator>();
    }
    [ContextMenu("Generate checkpoint id")]
    private void GenerateId()
    {
        checkPointId=System.Guid.NewGuid().ToString(); 
    }
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if(collision.GetComponent<Player>()!=null && actived==false)
        {
            ActiveCheckPoint();

        }
    }

    public void ActiveCheckPoint()
    {
        AudioManger.instance.PlaySFX(4, null);
        actived= true;
        anim.SetBool("Active", true);
    }
 
}
